package edu.maping.easy.model;

public class Point {

	public int x;
	public int y;

	public boolean first = false;

	public Point(int x, int y, boolean first) {
		super();
		this.x = x;
		this.y = y;
		this.first = first;
	}

	public Point(int x, int y) {
		this.x = x;
		this.y = y;
	}

	public int getX() {
		return x;
	}

	public void setX(int x) {
		this.x = x;
	}

	public int getY() {
		return y;
	}

	public void setY(int y) {
		this.y = y;
	}

	public void setXY(int x, int y) {
		setX(x);
		setY(y);
	}

	public Point copyPoint() {
		Point point = new Point(x, y);
		point.first = first;
		return point;
	}

	public void move(int x, int y) {
		this.x += x;
		this.y += y;
	}

	public double getDistance(Point point) {
		double dist = (x - point.x) * (x - point.x) + (y - point.y)
				* (y - point.y);
		dist = Math.sqrt(dist);
		return dist;
	}

	public boolean isThisPoint(int mouseX, int mouseY) {
		double dist = getDistance(new Point(mouseX, mouseY));
		boolean ok = dist < 12.5;
		return ok;
	}
}
